import http from '@/utils/http/axios.ts'

export interface UserInfo {
    id: number
    username: string
    email: string
}


export const login = (data: { username: string; password: string }) => {
    return http.post<UserInfo>('/api/users/login', data)
}

// 注册
export const register = (data: { username: string; password: string; email: string }) => {
    return http.post<UserInfo>('/api/users/register', data)
}